Many electronic devices include various types of input devices. One such input device is a rotary encoder. A rotary encoder is used to determine the angular velocity of a rotatable component associated with the electronic device. With some rotary encoders, a light source can illuminate a portion of a patterned surface of the rotatable component and an optical sensor can collect light reflected by the patterned surface and generate electrical signals corresponding to the collected light. The electronic device can receive and analyze the electrical signals for sequences of rising and falling edges to determine or estimate the angular velocity and/or direction of rotation of the rotatable component.
However, many encoders are not suitable for use within the constrained proportions of an electronic device that has a smaller form factor. As one example, smaller light sources may emit less light, smaller optical sensors may detect less light, and smaller rotatable components with patterned surfaces may be more difficult and/or expensive to manufacture. Furthermore, as angular velocity increases, the contrast of the light reflected by the patterned surface and collected by the optical sensor can decrease. As a result, the accuracy, precision, and/or reliability of angular velocity measurements derived from the optical sensor data can decrease with the size of the rotary encoder. In other examples, small form factor rotary encoders may be limited to a low-speed operation.
Additionally, in some embodiments the rate at which the optical sensor samples the reflected light is a fixed sampling rate. This fixed sampling rate may not be optimal for the rotational speed of the rotatable component. The sampling rate may be too low for higher rotating speeds, which can produce errors in the calculated angular velocity and/or direction of rotation. Similarly, the sampling rate can be too high when the rotatable component rotates at a lower speed. The high sampling rate can consume more power than is necessary. In battery-powered electronic devices, excess power consumption can needlessly reduce the amount of battery charge or power.